import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'

Vue.use(Router)

const router = new Router({
  routes: [,
    {
      path: '/',
      name: 'Hello',
      component: HelloWorld
    }
  ]
})

router.routes = {}

const load = async () =>{
  for (let i=1;i<5;i++){
    console.log('load route ' + i)
    router.routes['test' + i] = (await import('@/components/test' + i)).default
  }
}
load();

export default router